package com.leyou.item.client;

import com.leyou.common.dto.PageDTO;
import com.leyou.pojo.dto.SpuDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("item-service")
public interface ItemClient {

    /**
     * 分页查询spu
     * @param brandId  品牌id
     * @param categoryId 商品分类id
     * @param id spu id
     * @param page 当前页
     * @param rows 每页大小
     * @param saleable 是否上架
     * @return
     */
    @GetMapping("/goods/spu/page")
    PageDTO<SpuDTO> findSpuPage(
            @RequestParam(value = "brandId",required = false) Long brandId,
            @RequestParam(value = "categoryId",required = false) Long categoryId,
            @RequestParam(value = "id",required = false) Long id,
            @RequestParam(value = "page",defaultValue = "1") Integer page,
            @RequestParam(value = "rows",defaultValue = "5") Integer rows,
            @RequestParam(value = "saleable",required = false) Boolean saleable
    );
}
